const http = require('http');
const fs = require('fs');
const template = require('art-template');


/*
* 后台提供的数据的接口
* */
const server = http.createServer((req, res) => {

    res.setHeader('Content-Type', 'application/json;charset=utf-8');
    res.setHeader('Access-Control-Allow-Origin', '*');

    let userContent = fs.readFileSync('./db.json', 'utf-8');

    res.write(userContent);

    res.end();

});
const port = 8082;

server.listen(port, () => {
    console.log(`server is running at http://localhost:${port}`);
});
